home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 1
/
Nebula One.iso
/
Utilities
/
Scanner
/
Scan.0.91
/
Source
/
mycontentView.m
< prev
next >
Wrap
Text File
|
1996-02-03
|
986b
|
42 lines
#import "mycontentView.h"
@implementation mycontentView
- drawSelf:(const NXRect *)rects :(int)rectCount
{
NXSize theSize, newsize;
// max x-size = 8.5" x 1200 dpi = 10200 pixels.
// max y-size = 11.7" x 1200 dpi = 14040 pixels.
NXPoint position;
position.x = 0.0;
position.y = 0.0;
[self scale:1.0 : 1.0];
// We want to temporarily rescale the image so that it fits
// the view 1-to-1, pixel for pixel. We reset the size when we are done.
[displayImage getSize:&theSize]; // get old size
newsize.width = [displayImage pixelsWide]; // set new size variable
newsize.height = [displayImage pixelsHigh]; // ....
[displayImage setSize:&newsize]; // set new size
[displayImage drawAt:&position]; // display image
[displayImage setSize:&theSize]; // reset old size
return self;
}
- setImage:(NXBitmapImageRep *)theImage
{
displayImage = theImage;
[self sizeTo:[displayImage pixelsWide] :[displayImage pixelsHigh]];
return self;
}
@end